#ifndef __CRSFMediaSource__H__
#define __CRSFMediaSource__H__

#pragma warning(disable: 4786)

#include "MediaSource.h"
#include "RSF.h"
#include "RTPBuffer.h"

class CRSFMediaSource: public CMediaSource 
{
public:
	CRSFMediaSource();
	~CRSFMediaSource();

	virtual Bool GetSDP( std::string * outSDP, const char * vLocalIP );

	Bool AddTrack( UInt32 inTrackID, UInt32 & v_SSRC );

	Bool GetCurrentRtpInfo( UInt32 inTrackID, UInt16 &outSeqNo, UInt32 &outRtpTime );

	virtual ERRCODE	PreReadData(UInt32 v_Duration);

	virtual inline CRTPBuffer *GetDataBuffer() 
	{	
	  return &m_RTPBuffer;		
	}
	virtual ERRCODE		Seek(UInt64  vStartTime, Bool isSureKeyFrame=FALSE);
	virtual ERRCODE         Seek2(UInt64  vStartTime,UInt32 test=0);

	virtual ERRCODE		Pause();
	virtual void		FreeData();
	
private:
	// must get ssrc and rtp info from rfh file
	_RtpInfosMap	m_RtpInfos;

	CRsfMediaCollector*  m_pRsfCollector;

	CRTPBuffer           m_RTPBuffer;

};

#endif







